<?php

namespace Crc\Entity;

use Doctrine\ORM\Mapping AS ORM,
    Doctrine\Common\Annotations\AnnotationRegistry,
    Crc\Annotations\Filters as Filter,
    Crc\Annotations\Validators as Assert,
    Crc\Annotations\Form\Elements as Element,
    Crc\Annotations\Grid as Grid;

/**
 *
 *
 * @ORM\Entity
 * @ORM\Table(name="puddle")
 * @Grid\QuickActions(actions={"active", "inactive"})
 */

class Puddle extends AbstractEntity
{

    /**
     * Default statuses
     */
    const STATUS_DELETED  = -1;
    const STATUS_INACTIVE =  0;
    const STATUS_ACTIVE   =  1;


    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     * @Grid\Column(label="ID", show=true, default=false, sortable=true, order="ASC")
     * @Grid\Filter(name="number", label="ID")
      *
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     * @Grid\Filter(name="text", label="Name")
     */
    private $name;

    /**
     * @ORM\Column(type="float")
     * @Grid\Column(label="Latitude", show=true, default=true)
     */
    private $lat;

    /**
     * @ORM\ManyToOne(targetEntity="WaterType", inversedBy="puddles")
     * @ORM\JoinColumn(name="id_water_type", referencedColumnName="id")
     */
    private $waterType;

    /**
     * @ORM\Column(name="sort_order", type="integer")
     * @Grid\Column(label="Water type", show=true, default=true, sortable=true)     
     */
    private $sortOrder = 0;

    /**
    * @ORM\Column(type="integer")
    * @Grid\Column(label="Status", show=true, default=true, sortable=true)
    * @Grid\Filter(name="text", label="Status")
    */
    private $status = 0;

    public function setId($_id)
    {
        $this->id = $_id;
        return $this;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setName($_name)
    {
        $this->name = $_name;
        return $this;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setLat($_lat)
    {
        $this->lat = $_lat;
        return $this;
    }

    public function getLat()
    {
        return $this->lat;
    }

    public function setWaterType(WaterType $_waterType)
    {
        $_waterType->addPuddle($this);
        $this->waterType = $_waterType;
        return $this;
    }

    public function getWaterType()
    {
        return $this->waterType;
    }

    public function setSortOrder($_sortOrder)
    {
        $this->sortOrder = $_sortOrder;
        return $this;
    }

    public function getSortOrder()
    {
        return $this->sortOrder;
    }

    public function setStatus($_status)
    {
        $this->status = $_status;
        return $this;
    }

    public function getStatus()
    {
        return $this->status;
    }
}